import path from 'path';
import { static_tag } from './static-tag';

export enum EnvironmentAlias {
    nodeEnvironment = 'NODE_ENV',
}

const IS_DEV = process.env.NODE_ENV === 'development';

const PROJECT_PATH = path.resolve(__dirname, '../../../');
const PROJECT_NAME = path.parse(PROJECT_PATH).name;
const STATIC_PROJ_NAME = 'qing-qiu-react-static';
const STATIC_PROJ_BRANCH = 'with-static-resource';

const STATIC_RESOURCE_PATH = 'https://github.com/WinterSmileSB101/qingqiu-site-static';

//const STATIC_PATH_PRD = 'https://gitee.com/SmileSB101/dome-react-static/raw/with-static-resource/static';
const STATIC_PATH_PRD = `http://gitee.com/SmileSB101/${STATIC_PROJ_NAME}/raw/${STATIC_PROJ_BRANCH}/static`;
const STATIC_PATH_DEV = 'http://localhost:9627/';

const JSDELIVR_STATIC_PATH_PRD = `https://cdn.jsdelivr.net/gh/WinterSmileSB101/qingqiu-site-static@${static_tag}/static`;

export default {
    IS_DEV,
    PROJECT_PATH,
    STATIC_PATH_DEV,
    STATIC_PATH_PRD,
    JSDELIVR_STATIC_PATH_PRD
};
